<template>
  <div>
    <span>{{ message }}</span>
    <p>获取父组件的值为: {{ parentVal }}</p>
  </div>
</template>

<script>
export default {
  data() {
    return {
      message: "Vue",
    };
  },
  computed: {
    parentVal() {
      return this.$parent.msg;
    },
  },
};
</script>
